home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-26 | 815 b | 29 lines | [TEXT/KAHL] |
- /* Extra Routines required by THINK_C to make life easy Basil P. Duval 26 May 1992 */
-
- void SetFType(fil,type,creat)
- char *fil;
- unsigned long type,creat;
- /*
- * THINKC's stdio routines have the horrible habit of
- * making any file you open look like generic files.
- * This code tells the OS that it's a text file.
- * add line
- * extern void SetFType(char *fil,unsigned long type,unsigned long creat);
- */
- {
- fileParam pb;
- OSErr error=FALSE;
-
- CtoPstr(fil);
- pb.ioNamePtr = (StringPtr)fil;
- pb.ioVRefNum = 0;
- pb.ioFVersNum = 0;
- pb.ioFDirIndex = 0;
- error = PBGetFInfo(&pb,0);
- if (error == noErr) {
- pb.ioFlFndrInfo.fdCreator = creat;
- pb.ioFlFndrInfo.fdType = type;
- error = PBSetFInfo(&pb, 0);
- }
- PtoCstr(fil);
- }